package easy;

public class Solution_1880 {

    public boolean isSumEqual(String firstWord, String secondWord, String targetWord) {
        long a = get(firstWord);
        long b = get(secondWord);
        long c = get(targetWord);
        return (a + b) == c;
    }

    private long get(String str) {
        long num = 0;
        for (int i = 0; i < str.length(); i++) {
            int c = str.charAt(i);
            if (c != 'a' || num > 0) {
                num *= 10;
                num += (c - 'a');
            }
        }
        return num;
    }

    public static void main(String[] args) {
        Solution_1880 model = new Solution_1880();
        System.out.println(model.isSumEqual("j", "j", "bi"));
    }
}
